home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / SmallEiffel 0.3.3 / SmallEiffel 68k / lib_test / test_pointer1.e < prev    next >
Encoding:
Text File  |  1996-06-13  |  772 b   |  43 lines  |  [TEXT/EDIT]

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_POINTER1
  5.  
  6. creation make
  7.    
  8. feature 
  9.    
  10.    make is
  11.       local
  12.      p: POINTER;
  13.      a: ANY;
  14.      pr: POINTER_REF;
  15.       do
  16.      is_true(p /= Void);
  17.      is_true(not (p = Void));
  18.      is_true(p.is_void);
  19.      is_true(not p.is_not_void);
  20.  
  21.      a := p;
  22.      is_true(a /= Void);
  23.      pr := p;
  24.      is_true(pr /= Void);
  25.      is_true(pr.item.is_void);
  26.       end;
  27.    
  28.    is_true(b: BOOLEAN) is
  29.       do
  30.      cpt := cpt + 1;
  31.      if not b then
  32.         std_output.put_string("TEST_POINTER1: ERROR Test # ");
  33.         std_output.put_integer(cpt);
  34.         std_output.put_string("%N");
  35.      else
  36.         -- std_output.put_string("Yes%N");
  37.      end;
  38.       end;
  39.    
  40.    cpt: INTEGER;
  41.    
  42. end -- TEST_POINTER1
  43.